using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class AT2_MapMap : EntityTypeConfiguration<AT2_Map>
    {
        public AT2_MapMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Code)
                .HasMaxLength(50);

            this.Property(t => t.Object)
                .HasMaxLength(50);

            this.Property(t => t.ObjectCaption)
                .HasMaxLength(50);

            this.Property(t => t.ObjectType)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("AT2_Map");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Code).HasColumnName("Code");
            this.Property(t => t.Object).HasColumnName("Object");
            this.Property(t => t.ObjectCaption).HasColumnName("ObjectCaption");
            this.Property(t => t.ObjectType).HasColumnName("ObjectType");
        }
    }
}
